﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SIP
{
    public partial class Principal : System.Web.UI.MasterPage
    {
        int perfil;
        protected void Page_Load(object sender, EventArgs e)
        {
            perfil = Convert.ToInt16(Session["Perfil"]);
            if (perfil == 1)
            {
                Administrador();
            }
            if (perfil == 2)
            {
                UsuarioAplicacion();
            }
            if (perfil == 3)
            {
                UsuarioConsulta();
            }
        }

        public void Administrador()
        {
            //habilita mantenimientos
            NavBarItem5.Visible  = true;
            NavBarItem6.Visible = true;
            NavBarItem7.Visible = true;
            NavBarItem8.Visible = true;
            NavBarItem9.Visible = true;
            NavBarItem10.Visible = true;
            NavBarItem11.Visible = true;
            //habilita seguridad
          //  NavBarItem13.Visible = true;
            NavBarItem14.Visible = true;
          //  NavBarItem15.Visible = true;
        }

        public void UsuarioAplicacion()
        {
            //deshabilita mantenimientos
            NavBarItem5.Visible = false;
            NavBarItem6.Visible = false;
            NavBarItem7.Visible = false;
            NavBarItem8.Visible = false;
            NavBarItem9.Visible = false;
            NavBarItem10.Visible = true;
            NavBarItem11.Visible = true;
            //deshabilita seguridad
          //  NavBarItem13.Visible = false;
            NavBarItem14.Visible = false;
          //  NavBarItem15.Visible = false;
            NavBarItem12.Visible = false;
        }

        public void UsuarioConsulta()
        {
            //deshabilita mantenimientos
            NavBarItem4.Visible = false;
            NavBarItem5.Visible = false;
            NavBarItem6.Visible = false;
            NavBarItem7.Visible = false;
            NavBarItem8.Visible = false;
            NavBarItem9.Visible = false;
            NavBarItem10.Visible = false;
            NavBarItem11.Visible = false;
            //deshabilita seguridad
            NavBarItem12.Visible = false;
         //   NavBarItem13.Visible = false;
            NavBarItem14.Visible = false;
          //  NavBarItem15.Visible = false;
            NavBarItem16.Visible = false;
            //deshabilita Constancias
            NavBarItem17.Visible = false;
            NavBarItem18.Visible = false;
            NavBarItem19.Visible = false;
        }
    }
}